package flc.ast.adapter;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import flc.ast.R;
import flc.ast.bean.MyCollectBean;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;

public class CollectAdapter extends StkProviderMultiAdapter<MyCollectBean> {


    public CollectAdapter() {
        addItemProvider(new CollectItemProvider());
    }


    private class CollectItemProvider extends BaseItemProvider<MyCollectBean> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_music;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, MyCollectBean bean) {
            baseViewHolder.setText(R.id.tvMusicItemName, bean.getMidFileBean().getFileName());
            baseViewHolder.setImageResource(R.id.ivMusicItemImg, bean.getImg());
            baseViewHolder.setImageResource(R.id.ivMusicItemCollect, R.drawable.sc1);
        }
    }
}
